<template>
  <footer class="footer">
    <div class="container">
      <div class="footer-content">
        <div class="footer-logo">
          <h3>Dian Shagn</h3>
        </div>
        <div class="footer-links">
          <h4>快速链接</h4>
          <ul>
            <li><router-link to="/">首页</router-link></li>
            <li v-if="isLoggedIn"><router-link to="/add-movie">添加商品</router-link></li>
          </ul>
        </div>
        <div class="footer-contact">
          <h4>联系我们</h4>
          <p>Email: contact@Dian Shagn.com</p>
        </div>
      </div>
      <div class="footer-bottom">
        <p>&copy; {{ new Date().getFullYear() }}Dian Shagn. All rights reserved.</p>
      </div>
    </div>
  </footer>
</template>

<script setup>
import { computed } from 'vue';
import { useUserStore } from '@/stores/user';

const store = useUserStore();

const isLoggedIn = computed(() => store.isLoggedIn);
</script>

<style scoped>
.footer {
  background-color: #1a1a2e;
  color: white;
  padding: 40px 0 20px;
  margin-top: 40px;clear: both;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 30px;
}

.footer-logo {
  flex: 1;
  min-width: 200px;
  margin-bottom: 20px;
}

.footer-logo img {
  height: 40px;
  margin-right: 10px;
}

.footer-logo h3 {
  display: inline-block;
  font-size: 1.2rem;
}

.footer-links, .footer-contact {
  flex: 1;
  min-width: 200px;
  margin-bottom: 20px;
}

.footer-links h4, .footer-contact h4 {
  margin-bottom: 15px;
  font-size: 1rem;
  border-bottom: 1px solid #e94560;
  padding-bottom: 8px;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a, .footer-contact a {
  color: #aaa;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover, .footer-contact a:hover {
  color: #e94560;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #333;
  color: #888;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
  }
  
  .footer-logo, .footer-links, .footer-contact {
    margin-bottom: 30px;
  }
}
</style>